import request from '@/utils/request'
// 更新浏览记录、点赞记录
export function updateInformationRecord(id,data) {
    return request({
        url: '/api/categories/update/record/'+id,
        method: 'put',
        data: data
    })
}
// 查询列表
export function findAllCategories(query) {
    return request({
        url: '/api/categories/list',
        method: 'post',
        data: query
    })
}
export function findAllMyCategories(query) {
    return request({
        url: '/api/categories/list/my',
        method: 'post',
        data: query
    })
}
// 查询详情
export function getCategories(id) {
    return request({
        url: '/api/categories/' + id,
        method: 'get'
    })
}

// 新增
export function addCategories(data) {
    return request({
        url: '/api/categories/',
        method: 'post',
        data: data
    })
}

// 修改
export function updateCategories(id,data) {
    return request({
        url: '/api/categories/update/'+id,
        method: 'put',
        data: data
    })
}

// 删除
export function delCategories(id) {
    return request({
      url: `/api/categories/${id}/off`,
        method: 'DELETE'
    })
}